import tornado.web
from db import LogsDB

class HomeHandler(tornado.web.RequestHandler):
  async def get(self):
    # 定义一些数据
    user = {"name": "Alice", "age": 30}
    logs = await LogsDB.all()
    # 渲染模板并传递数据
    self.render("index.html", logs=logs, user=user)